package com.btc.study.sort;

/**
 * @Auther: hq
 * @Description: 归并排序
 * @Date 2019/6/25 11:20
 */
public class MergeSort {


    public static int[] mergeSort(int[] A , int n){
        return mergeSortC(A, 0, n -1);
    }

    private static int[] mergeSortC(int[] A, int p, int r) {
        if( p > r){
            return A;
        }
        int q = (p + r)/2;
        int[] sortPQ = mergeSortC(A, p, q);
        int[] sortQR =  mergeSortC(A, q+1, r);
        A = merge(A, sortPQ, sortQR );
        return A;
    }

    private static int[] merge(int[] A, int[] sortPQ, int[] sortQR) {
        return null;


    }


}
